#ifndef THINK_THINK_MODEL_COLLECTION_H
#define THINK_THINK_MODEL_COLLECTION_H

static char* think_model_collection =
	"\n"
	"// +----------------------------------------------------------------------\n"
	"// | ThinkPHP [ WE CAN DO IT JUST THINK ]\n"
	"// +----------------------------------------------------------------------\n"
	"// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.\n"
	"// +----------------------------------------------------------------------\n"
	"// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )\n"
	"// +----------------------------------------------------------------------\n"
	"// | Author: zhangyajun <448901948@qq.com>\n"
	"// +----------------------------------------------------------------------\n"
	"\n"
	"namespace think\\model;\n"
	"\n"
	"use think\\Collection as BaseCollection;\n"
	"use think\\Model;\n"
	"\n"
	"class Collection extends BaseCollection\n"
	"{\n"
	"    /**\n"
	"     * 延迟预载入关联查询\n"
	"     * @access public\n"
	"     * @param mixed $relation 关联\n"
	"     * @return $this\n"
	"     */\n"
	"    public function load($relation)\n"
	"    {\n"
	"        $item = current($this->items);\n"
	"        $item->eagerlyResultSet($this->items, $relation);\n"
	"        return $this;\n"
	"    }\n"
	"\n"
	"    /**\n"
	"     * 设置需要隐藏的输出属性\n"
	"     * @access public\n"
	"     * @param array $hidden   属性列表\n"
	"     * @param bool  $override 是否覆盖\n"
	"     * @return $this\n"
	"     */\n"
	"    public function hidden($hidden = [], $override = false)\n"
	"    {\n"
	"        $this->each(function ($model) use ($hidden, $override) {\n"
	"            /** @var Model $model */\n"
	"            $model->hidden($hidden, $override);\n"
	"        });\n"
	"        return $this;\n"
	"    }\n"
	"\n"
	"    /**\n"
	"     * 设置需要输出的属性\n"
	"     * @param array $visible\n"
	"     * @param bool  $override 是否覆盖\n"
	"     * @return $this\n"
	"     */\n"
	"    public function visible($visible = [], $override = false)\n"
	"    {\n"
	"        $this->each(function ($model) use ($visible, $override) {\n"
	"            /** @var Model $model */\n"
	"            $model->visible($visible, $override);\n"
	"        });\n"
	"        return $this;\n"
	"    }\n"
	"\n"
	"    /**\n"
	"     * 设置需要追加的输出属性\n"
	"     * @access public\n"
	"     * @param array $append   属性列表\n"
	"     * @param bool  $override 是否覆盖\n"
	"     * @return $this\n"
	"     */\n"
	"    public function append($append = [], $override = false)\n"
	"    {\n"
	"        $this->each(function ($model) use ($append, $override) {\n"
	"            /** @var Model $model */\n"
	"            $model && $model->append($append, $override);\n"
	"        });\n"
	"        return $this;\n"
	"    }\n"
	"\n"
	"}\n"
	"\n"
;
#endif